﻿CREATE TABLE [dbo].[repertories] (
    [ID]          INT             IDENTITY (1, 1) NOT NULL,
    [OrderNo]     VARCHAR (20)    NULL,
    [ProductID]   INT             NOT NULL,
    [Quantity]    DECIMAL (18, 5) NOT NULL,
    [Balance]     DECIMAL (18, 5) NOT NULL,
    [Description] VARCHAR (100)   NULL,
    [CreatedOn]   DATETIME        NOT NULL,
    [Method]      INT             CONSTRAINT [DF__repertori__Metho__44FF419A] DEFAULT ('1') NOT NULL,
    [HouseID]     INT             NOT NULL,
    [Retention]   VARCHAR (10)    NULL,
    [FinalCost]   DECIMAL (18, 5) CONSTRAINT [DF_repertories_FinalCost] DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK__repertor__3214EC2730F848ED] PRIMARY KEY CLUSTERED ([ID] ASC),
    CONSTRAINT [FK_repertories_products] FOREIGN KEY ([ProductID]) REFERENCES [dbo].[products] ([ID]),
    CONSTRAINT [FK_repertories_warehouses] FOREIGN KEY ([HouseID]) REFERENCES [dbo].[warehouses] ([ID])
);



